package com.lunwen.lunwen.api;

import com.lunwen.lunwen.bean.Mubantask;
import com.lunwen.lunwen.bean.Result;
import com.lunwen.lunwen.bean.ThesisTask;
import com.lunwen.lunwen.bean.ThesisTaskLog;
import com.lunwen.lunwen.services.ThesisTaskLogService;
import com.lunwen.lunwen.services.ThesisTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * (ThesisTask)表控制层
 *
 * @author makejava
 * @since 2020-08-11 09:25:34
 */
@RestController
@RequestMapping("api")
public class ThesisTaskController {

    /**
     * 服务对象
     */
    @Autowired
    private ThesisTaskService thesisTaskService;



    /**
     * 通过主键查询单条数据
     *
     * @param thesisTask 主键
     * @return 单条数据
     */

    @RequestMapping(value = "/thesistaskadd", method = RequestMethod.POST, consumes = "application/json")
    public Result thesistaskadd(@RequestBody ThesisTask thesisTask) {
        Result result = new Result();

        result.setResult("501","生成任务录入成功！");
        result.setData(this.thesisTaskService.insert(thesisTask));

        return result;
    }

    /**
     * 通过主键查询单条数据
     *
     * @param
     * @return 单条数据
     */
    @GetMapping("thesistaskcheck")
    public Result thesistaskcheck()
    {
        Result result = new Result();
        result.setResult("502","查询任务录入成功！");
        result.setData(this.thesisTaskService.thesistaskcheck());
        return result;
    }


    /**
     * 通过主键查询单条数据
     *
     * @param
     * @return 单条数据
     */
    @RequestMapping(value = "/updateovertask", method = RequestMethod.POST, consumes = "application/json")
    public Result updateovertask(@RequestBody ThesisTask thesisTask)
    {
        Result result = new Result();
        result.setResult("503","任务完成成功！");
        result.setData(this.thesisTaskService.updateovertask(thesisTask));

        return result;
    }
}